/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package junchangmis.student;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import publicmethod.*;
import java.util.Vector;
import java.sql.ResultSet;

/**
 *
 * @author developers
 */
public class birthChooseMethod {

    public static boolean hasFormalStuAsBirth(String md, Vector<String> names, Vector<String> classCodes, Vector<String> tels) {//根据出生月日查询学生
        try {
            DbOperation db = new DbOperation();
            db.DbConnect();
            String sql = "select * from formalStu";
            ResultSet rs = db.DBSqlQuery(sql);
            while (rs.next()) {
                String birthday = rs.getString("birthday");
                if (md.equals(birthday.substring(5))) {
                    names.add(rs.getString("name"));
                    classCodes.add(rs.getString("classCode"));
                    tels.add(rs.getString("tel"));
                }
            }
            if (names.size() > 0) {
                return true;
            } else {
                return false;
            }
        } catch (SQLException ex) {
            Logger.getLogger(birthChooseMethod.class.getName()).log(Level.SEVERE, null, ex);
            return false;
        }

    }
}
